/**
 * Program  : BaseActivity.java
 * Author   : long
 * Create   : 2015年12月28日 上午10:14:08
 *
 * Copyright 2015 by Embedded Internet Solutions Inc.,
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Embedded Internet Solutions Inc.("Confidential Information").  
 * You shall not disclose such Confidential Information and shall 
 * use it only in accordance with the terms of the license agreement 
 * you entered into with Embedded Internet Solutions Inc.
 *
 */
	
package cn.broadin.app.hotel;

import java.io.File;

import com.lidroid.xutils.BitmapUtils;
import com.lidroid.xutils.bitmap.BitmapDisplayConfig;
import com.lidroid.xutils.bitmap.callback.BitmapLoadCallBack;
import com.lidroid.xutils.bitmap.callback.BitmapLoadFrom;

import cn.broadin.app.hotel.util.XDialog;
import pl.droidsonroids.gif.GifDrawable;
import pl.droidsonroids.gif.GifImageView;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

/**
 * 基础类
 * 
 * @author   long
 * @version  1.0.0
 * @date 2015年12月28日上午10:14:08
 */
public class BaseActivity extends Activity{
	
	public void showLoadingDialog() {
		XDialog.getInstance().show(this);
	}
	
	public void showLoadingDialog(String msg) {
		XDialog.getInstance().show(this, msg);
	}
	
	public void hideLoadingDialog() {
		XDialog.getInstance().hide();
	}

	/**
	 * 加载bitmap图片
	 * 
	 * @author   long
	 * @param imageView
	 * @return void
	 * @exception
	 * @author   long
	 * @since 1.0.0
	 * @date 2015年9月23日 下午4:32:44
	 */
	public void loadBitmap(final ImageView imageView, String uri){
		BitmapUtils bitmapUtils = new BitmapUtils(getApplicationContext());
		BitmapDisplayConfig displayConfig = new BitmapDisplayConfig();
		displayConfig.setAnimation(AnimationUtils.loadAnimation(getApplicationContext(), R.anim.image_change));
		bitmapUtils.configDefaultDisplayConfig(displayConfig);
		bitmapUtils.display(imageView, uri);
	}
}
